# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-m2r
_pkgname=m2r
pkgver=0.2.1
pkgrel=7
pkgdesc='Markdown and reStructuredText in a single file.'
url='https://pypi.org/project/m2r/#files'
arch=('any')
license=('MIT')
depends=('python2' 'python2-mistune' 'python2-docutils')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('4e68e8d5a2d4645d2f7c68c0412b24e1f69845af344a96b8a7120106117e9f08ebeba1ddf0351e33dc6eeb475f89836caf1eefe6168ad003750bfa9081534bbe')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

